package com.diaohw.platform.utility.uml.core.obj;

import com.diaohw.platform.utility.uml.core.enums.AccessModifierEnum;
import lombok.Data;

import java.util.List;

@Data
public class FieldBO {

    private String name;

    private String classType;

    private List<String> params;

    private AccessModifierEnum modifier;

    public boolean staticAttr;

    public static FieldBO of(String name, String classType, AccessModifierEnum modifier) {
        FieldBO bo = new FieldBO();
        bo.name = name;
        bo.classType = classType;
        bo.modifier = modifier;
        return bo;
    }

    public static FieldBO of(String name) {
        FieldBO bo = new FieldBO();
        bo.name = name;
        return bo;
    }

    public String getName() {
        if (staticAttr) {
            return "static " + name;
        }
        return name;
    }

}
